
// 公用下拉框
import { orgApis } from '@/api/vesalesapi'
const data = [
  {
    compKey: 'carSeries',
    labelName: '车系名称：',
    codeField: 'carSeriesId',
    textField: 'carSeriesCn',
    oFields: 'carSeriesId,carSeriesCn',
    customObj: { api: orgApis.listOfCarSeries, selectType: '1' },
    component: () => import('@/components/org/commonSelect'),
    isRequire: false,
    isMust: false,
    span: 6
  },
  {
    compKey: 'carConfig',
    labelName: '基础车型名称：',
    codeField: 'carConfigId',
    textField: 'carConfigCn',
    component: () => import('@/components/org/commonSelect'),
    oFields: 'carConfigId,carConfigCn',
    parentFileds: 'value:carSeriesId',
    customObj: {
      listQuery: { carSeriesId: '' },
      api: orgApis.listOfCarModel, selectType: '1'
    },
    isRequire: false,
    isMust: false,
    span: 6
  },
  {
    compKey: 'optionalPag',
    labelName: '选装包：',
    codeField: 'optionalPagId',
    textField: 'optionalPagName',
    component: () => import('@/components/org/commonSelect'),
    parentFileds: 'value:carConfigId|carSeriesId',
    oFields: 'optionalPagId,optionalPagName',
    customObj: {
      listQuery: {
        carConfigId: '', carSeriesId: ''
      },
      api: orgApis.listOfPackage, selectType: '1'
    },
    type: 'inputText',
    isRequire: false,
    isMust: false,
    span: 6
  },
  {
    compKey: 'carColor',
    labelName: '车身颜色：',
    codeField: 'carColorId',
    textField: 'carColorName',
    component: () => import('@/components/org/commonSelect'),
    parentFileds: 'value:carConfigId|carSeriesId|optionalPagId',
    oFields: 'carColorId,carColorName',
    customObj: {
      listQuery: {
        carConfigId: '', carSeriesId: '', optionalPagId: ''
      },
      api: orgApis.listOfCarColor, selectType: '1'
    },
    type: 'inputText',
    isRequire: false,
    isMust: false,
    span: 6
  },
  {
    compKey: 'carIncolor',
    labelName: '内饰颜色：',
    codeField: 'carIncolorId',
    textField: 'carIncolorName',
    component: () => import('@/components/org/commonSelect'),
    parentFileds: 'value:carConfigId|carSeriesId|optionalPagId',
    oFields: 'carIncolorId,carIncolorName',
    customObj: {
      listQuery: {
        carConfigId: '', carSeriesId: '', optionalPagId: ''
      },
      api: orgApis.listOfCarInterior, selectType: '1'
    },
    type: 'inputText',
    isRequire: false,
    isMust: false,
    span: 6
  }
]

function ModelOptions(type) {
  // type:1   门店销售计划制定时机设置   门店销售计划比例设置
  //  2:总部月销售计划制定  门店月销售计划审核
  if (type === 1) {
    data[0].isMust = true
    data[1].isMust = false
    data[2].isMust = false
    data[3].isMust = false
  } else if (type === 2) {
    data[0].isMust = true
    data[1].isMust = true
    data[2].isMust = true
    data[3].isMust = true
  }
  return data
}

export default {
  ModelOptions
}
